package com.start.security.service;

import cn.hutool.http.server.HttpServerRequest;
import com.start.security.model.StartDataSecurityModel;
import jakarta.servlet.http.HttpServletRequest;

import java.util.List;

public interface StartSecurityService {

    List<String> getIgnoreAuthUrl();

    List<String> getSecurityUrls();


    default boolean hasDataSecurity(HttpServletRequest httpServletRequest) {
        return hasDataSecurity(httpServletRequest.getRequestURI());
    }

    boolean hasDataSecurity(String url);


    StartDataSecurityModel createClientSymmetricKey(String data);

    /**
     * 更新client密钥
     *
     * @param clientId
     * @return
     */
    void updateClientDecryptionKey(String clientId);

    /**
     * 移除客户端密钥
     *
     * @param clientId
     */
    void deleteClientDecryptionKey(String clientId);

    /**
     * 删除当前客户端密钥信息
     *
     * @param request
     */
    void deleteCurrentClientDecryptionKey(HttpServerRequest request);


}
